<!doctype html>
<%@page import="java.io.File"%>

<%
	String currentJsp = request.getRealPath("/") + "products";
	currentJsp = currentJsp.replace("\\", "/");
%>
<html>
<head>
<meta charset="utf-8">
<title>Demo</title>

<!--  jquery -->
<script src="../js/jquery-1.8.1.js"></script>
<!-- jquery file using connector -->
<script src="../js/jqueryFileTree.js" type="text/javascript"></script>

<link href="../css/jqueryFileTree.css" rel="stylesheet" type="text/css"
	media="screen" />

<!--  jquery UI-->
<script src="../ui/jquery.ui.core.js"></script>
<script src="../ui/jquery.ui.widget.js"></script>
<script src="../ui/jquery.ui.mouse.js"></script>
<script src="../ui/jquery.ui.draggable.js"></script>
<script src="../ui/jquery.ui.sortable.js"></script>


<style>
.demo ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
	margin-bottom: 10px;
}

.demo li {
	margin: 5px;
	padding: 5px;
	width: 150px;
}
</style>

<script type="text/javascript">
	$(document)
			.ready(
					function() {
				$('#fileTreeDemo_1')
								.fileTree(
										{
										root :'<%=currentJsp%>',
			script : '../connectors/jqueryFileTree.jsp'
		}, function(file) {
			alert(file);

		});

	

		/*		$('#fileTreeDemo_2').fileTree({ root: '../WebContent/', script: '../connectors/jqueryFileTree.jsp', folderEvent: 'click', expandSpeed: 750, collapseSpeed: 750, multiFolder: false }, function(file) { 
					alert(file);
				});
				
				$('#fileTreeDemo_3').fileTree({ root: '../WebContent/', script: '../connectors/jqueryFileTree.jsp', folderEvent: 'click', expandSpeed: 750, collapseSpeed: 750, expandEasing: 'easeOutBounce', collapseEasing: 'easeOutBounce', loadMessage: 'Un momento...' }, function(file) { 
					alert(file);
				});
				
				$('#fileTreeDemo_4').fileTree({ root: '../WebContent/', script: '../connectors/jqueryFileTree.jsp', folderEvent: 'dblclick', expandSpeed: 1, collapseSpeed: 1 }, function(file) { 
					alert(file);
				});*/

	}
	);
	
		function postMilestones(xmlContent) {
			//var xmlContent = $("#textarea_" + milestoneID).val();
			//alert(xmlContent);
			$.post("PostMilestones.jsp", {
				//milestoneID : milestoneID,
				xmlContent : xmlContent
			}, function(data) {
				alert("posted");
			});
		}
</script>

</head>
<body>


	<div class="example">
		<h2>Default options</h2>
		<div id="fileTreeDemo_1" class="demo"></div>
	</div>
</body>
</html>